﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucPostGridView.ascx.cs" Inherits="WapCrawler.Controls.ucPostGridView" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>
<script src="../../Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function CheckUnCheckAll(chkAll) {
        $('#<%=PostGridView.ClientID %>').find("input:checkbox[name$=chkSelect]").each(function () {
            this.checked = chkAll.checked;
        });
    }
</script>

<asp:GridView ID="PostGridView" runat="server" AllowPaging="True" 
    AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" 
    BorderStyle="None" BorderWidth="1px" CellPadding="4" 
    DataKeyNames="postId" DataSourceID="PostLinqDataSource" 
    onrowdatabound="PostGridView_RowDataBound">
    <Columns>
        <asp:TemplateField HeaderText="Select" ItemStyle-HorizontalAlign="Center">
            <HeaderTemplate>
                <asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:CheckUnCheckAll(this);" />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="chkSelect" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField >
            <HeaderTemplate>
                Post
            </HeaderTemplate>
            <ItemTemplate>
                <asp:HyperLink ID="postUrlHyperLink" NavigateUrl='' runat="server" Style="float: left;
                    padding-right: 4px">
                    <asp:Image ID="Image1" Width="53" Height="53" ImageUrl='<%#Eval("thumbnailUrl")%>'
                        runat="server" />
                </asp:HyperLink>
                <h3>
                    <asp:HyperLink ID="postTitleHyperLink" NavigateUrl='' runat="server" Text='<%#Eval("title")%>'></asp:HyperLink>
                </h3>
                <span class="down">
                    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                    <!--<a class="show-cat" href="http://gaupanda.hayday.mobi/game-offline/.html">Game Offline</a> -->
                    <!--<asp:HyperLink ID="cat" class="show-cat" NavigateUrl="http://gaupanda.hayday.mobi/game-offline/.html" runat="server">HyperLink</asp:HyperLink>-->
                    <em>·</em> <span>Lượt xem: 0000 </span>
                    <br />
                    </span>
                    <span class="desc">
                        <%#Eval("head")%></span>
                    <div class="content">
                        <%#Eval("content")%>
                    </div>
            </ItemTemplate>
            <FooterTemplate>
            </FooterTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:LinkButton ID="lbkEdit" runat="server" Text="Edit" OnClick="lbkEdit_Click" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
    <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
    <PagerSettings Mode="NumericFirstLast" />
    <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
    <RowStyle BackColor="White" ForeColor="#003399" />
    <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
    <SortedAscendingCellStyle BackColor="#EDF6F6" />
    <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
    <SortedDescendingCellStyle BackColor="#D6DFDF" />
    <SortedDescendingHeaderStyle BackColor="#002876" />
</asp:GridView>
<asp:LinqDataSource ID="PostLinqDataSource" runat="server" 
    ContextTypeName="WapCrawlerLib.WapDataClassesDataContext" EntityTypeName="" 
    onselecting="PostLinqDataSource_Selecting" TableName="Posts">
</asp:LinqDataSource>

<%--<asp:Repeater ID="Repeater1" runat="server" DataSourceID="PostLinqDataSource">
 <ItemTemplate>
                <asp:HyperLink ID="postUrlHyperLink" NavigateUrl='' runat="server" Style="float: left;
                    padding-right: 4px">
                    <asp:Image ID="Image1" Width="53" Height="53" ImageUrl='<%#Eval("thumbnailUrl")%>'
                        runat="server" />
                </asp:HyperLink>
                <h3>
                    <asp:HyperLink ID="postTitleHyperLink" NavigateUrl='' runat="server" Text='<%#Eval("title")%>'></asp:HyperLink>
                </h3>
                <span class="down">
                    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                    <!--<a class="show-cat" href="http://gaupanda.hayday.mobi/game-offline/.html">Game Offline</a> -->
                    <!--<asp:HyperLink ID="cat" class="show-cat" NavigateUrl="http://gaupanda.hayday.mobi/game-offline/.html" runat="server">HyperLink</asp:HyperLink>-->
                    <em>·</em> <span>Lượt xem: 0000 </span>
                    <br />
                    </span>
                    <span class="desc">
                        <%#Eval("head")%></span>
                    <div class="content">
                        <%#Eval("content")%>
                    </div>
                    <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
            </ItemTemplate>
</asp:Repeater>--%>


